package com.bit.demo;

class Text{
    public int a;
    static int b;
    private static int c;
    {
        System.out.println("构造代码块一般用于初始化实例成员变量。");

    }
    static{
        System.out.println("静态代码块！一般用于初始化静态的成员变量");
    }
    public Text(int a) {
        this.a = a;
    }

    @Override
    public String toString() {
        return "Text{" +
                "a=" + a +
                '}';
    }
}

class Text1{
    private static int x = 100;
}
public class TextDemo {
    public static void main(String[] args) {
        Text1 text = new Text1();
        text.x++;
    }
    public static void main2(String[] args) {
        Text text = new Text(100);


    }
    public static void main1(String[] args) {
        Text text = new Text(100);
        System.out.println(text);
    }
}
